﻿using System;
using System.Collections.Generic;
using Equation.Enterprise.Framework.Domain.Model;
using Equation.Enterprise.Utilities.DesignByContract;

namespace ENail.Domain.Core
{
    public class NailSalon : EntityWithTypedId<Int16>
    {
        public string Name { get; set; }
        public string Paypal { get; set; }
        public string Description { get; set; }

        public IList<Employee> Employees { get; set; }
        public IList<NailService> NailServices { get; set; }
        public IList<Category> Categories { get; set; }
        public IList<Registration> Registrations { get; set; }
        public IList<User> Users { get; set; }
        public IList<Customer> Customers { get; set; }
        public IList<Vendor> Vendors { get; set; }

        public NailSalon(string name, string paypal, string description) : this()
        {
            Name = name;
            Paypal = paypal;
            Description = description;
        }

        public NailSalon()
        {
            Employees = new List<Employee>();
            NailServices = new List<NailService>();
            Categories = new List<Category>();
            Registrations = new List<Registration>();
            Users = new List<User>();
        }

        public void AddUser(User user)
        {
            Check.Require(user != null, "User to be added should no be null");

            user.NailSalon = this;
            this.Users.Add(user);
        }
    }
}
